'''
Created on 2012-1-29

@author: xiaokan
'''
#
#class Tag(object):
#    '''
#    This is the model of HTML Tags which used in the HTMLParser to build the tree
#    '''
#    
#    def __init__(self):
#        self.tag_name = ''
#        self.tag_attr = []
#        self.tag_data = []
#        self.sub_tags = []
#
#d = Tag()
#d.tag_name="22"
#d.sub_tags.append("1")
#
#e = Tag()
#e.tag_name='33'
#e.sub_tags.append("2")
#
##d.sub_tags.append(e)
#
#
#print d.tag_name, e.tag_name
#print d.sub_tags, e.sub_tags
#import pprint
#import urllib2
from xiaokan.RobotsUtils import RobotsHelper

#arr = [('itemscope', None), ('itemtype', 'http://schema.org/WebPage')]
#for name, value in arr:
#    print name, value
#
#from xiaokan.Utils import MyHTMLParser
#
#parser = MyHTMLParser()
#parser.feed("<ol><li></li><li><a></a></li><li></li><li></li></ol>")
#tree = parser.get_tag_tree()
#pass


#parser = HyperlinkParser()
#parser.feed_url("http://www.google.com")
#links = parser.get_links()
#for link in links:
#    print link

#opener = urllib2.build_opener()
#response = opener.open("http://nikitathespider.com/python/rerp/")
#pass


def main():
#    rh = RobotsHelper()
#    print rh.is_url_allowed("https://www.google.com/url?sa=p&pref=ig&pval=3&q=http://www.google.com/ig%3Fhl%3Den%26source%3Diglk&usg=AFQjCNFA18XPfgb7dKnXfKz7x7g1GDH1tg")

    d = [1, 2, 3, 4]
    for i in d:
        print i
        d.append(i + 4)

if __name__ == '__main__':
    main()
